import { _decorator, Component, Node } from 'cc';
import { DataItemLayout } from '../../../Core/DataItemLayout';
const { ccclass, property } = _decorator;

function getMinMax(min:number, max:number){
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

@ccclass('BagPanel')
export class BagPanel extends Component {
    @property(DataItemLayout)
    itemLayout:DataItemLayout

    protected onLoad(): void {
        let datas:{icon:number, quality:number, count:number}[] = []
        for (let i = 0; i < 500; i++) {
            datas.push({icon:getMinMax(1, 5), quality:getMinMax(1, 5), count:getMinMax(1, 100)})
        }

        this.itemLayout.bindDatas(datas)
    }
}


